<?php  session_start(); ?>
<html>
<head>
<title>oPanel</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet"href="style.css" />
</head>
<body>
<center><img src="images/logo.png"></center>
<?php include('functions.php');
if ($_SESSION["pass"] != check($_SESSION["user"])) { secure(); exit; }
if(!isset($_GET['new']) || !isset($_GET['old'])) {
die("Variables not set!");
}
$new = $_GET['new'];
$old = $_GET['old'];
if(isset($_GET['file'])) {
$file = $_GET['file'];
rename("$old$file", "$new$file");
echo "
<table border=0 width=100% valign=middle align=center>
<tr>
<td>

<img src=\"images/i-regular.gif\" border=\"0\" />
</td>
<td>
<img src=\"images/forward.gif\">
</td>
<td><img src=\"images/i-directory.gif\" width=\"16\" height=\"16\"> </td>
</tr>
<tr>
<td>
".$file."
</td>
<td>moved</td>
<td>
".$new."
</td>

</tr>
</table>";
} else {
$newfolder = $new."/".basename($old);
rename("$old", "$newfolder");
echo "
<table border=0 width=100% valign=middle align=center>
<tr>
<td>

<img src=\"images/i-regular.gif\" border=\"0\" />
</td>
<td>
<img src=\"images/forward.gif\">
</td>
<td><img src=\"images/i-directory.gif\" width=\"16\" height=\"16\"> </td>
</tr>
<tr>
<td>
".basename($old)."
</td>
<td>moved</td>
<td>
".$newfolder."
</td>

</tr>
</table>";
}
?>
<script type="text/javascript">
parent.filemain.location="http://<?php echo $_SERVER["HTTP_HOST"]; echo dirname("$_SERVER[SCRIPT_NAME]"); ?>/list.php?dir=<?php echo dirname($old); ?>/";
</script>
</body>
</html>